FROM golang:1.18 as builder
WORKDIR /opt/app
COPY go.* ./
RUN GOPROXY="https://goproxy.cn,direct" go mod download
COPY . .
RUN go build -o auth

FROM ubuntu:latest
WORKDIR /app
COPY --from=builder /opt/app/auth .
ENTRYPOINT ["/app/auth"]
CMD ["start"]
